
package ui.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import net.ck.hzq.R;

import java.util.ArrayList;
import java.util.List;

import Utils.CheckPhoneNumberUtils;
import base.BaseViewHolder;
import base.SuperBaseAdapter;
import dao.HomeNewsBean;


/**
 * 新闻
 * Created by chenjian on 19/2/27.
 */
public class EnterpriseassistanceAdapter extends SuperBaseAdapter<HomeNewsBean> {

    List<HomeNewsBean> mData = new ArrayList<>();
    Context mContext;

    public EnterpriseassistanceAdapter(Context context, List<HomeNewsBean> data) {
        super(context, data);
        mContext = context;
        mData = data;
    }

    @Override
    protected void convert(BaseViewHolder holder, final HomeNewsBean item, final int position) {
        ImageView imageView = holder.getView(R.id.listviewenterprise_img);
        Glide.with(mContext).load(item.getNewImag()).into(imageView);
        holder.setText(R.id.enterprise_txt1, item.getBt()).setText(R.id.enterprise_txt2, CheckPhoneNumberUtils.settime(item.getPushDate() + ""))
                .setText(R.id.enterprise_txt3, item.getReadNumber() + " 阅读");
    }


    @Override
    protected int getItemViewLayoutId(int position, HomeNewsBean item) {
        return R.layout.listviewenterpriseassistance_item1;
    }

}
